﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Fresatura.Pattern.RettangoloPatternView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:CustomControl="clr-namespace:CncConvProg.View.Controls" xmlns:ab="clr-namespace:CncConvProg.View.AttachedProperty" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Resources="clr-namespace:MecPrev.Resources;assembly=MecPrev.Resources" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="154*" />
        </Grid.ColumnDefinitions>
        <StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock MinWidth="120" Text="{x:Static Resources:EditWorkRes.RefPointPos}" Padding="0,0,2,0" Margin="0,0,2,0" />
                <ComboBox x:Name="cbMaterial" 
            				ItemsSource="{Binding Path=StartPointLookup}"
            				SelectedValue="{Binding Path=SelectedStartPoint}"
                            DisplayMemberPath="Value"
                            SelectedValuePath="Key" 
                            Width="100" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock MinWidth="120" Text="{x:Static Resources:EditWorkRes.Height}" Padding="0,0,2,0" Margin="0,0,2,0" />
                <TextBox  ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=Altezza, ValidatesOnDataErrors=True, TargetNullValue={x:Static System:String.Empty}, UpdateSourceTrigger=LostFocus}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock MinWidth="120" Text="{x:Static Resources:EditWorkRes.Width}" Padding="0,0,2,0" Margin="0,0,2,0" />
                <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=Larghezza, ValidatesOnDataErrors=True, TargetNullValue={x:Static System:String.Empty}, UpdateSourceTrigger=LostFocus}" Style="{DynamicResource TextBoxStyle1Dialog}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                <TextBlock Text="{x:Static Resources:EditWorkRes.RefPointX}" MinWidth="120" />
                <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=OffsetCentroX, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                <TextBlock Text="{x:Static Resources:EditWorkRes.RefPointY}" MinWidth="120" />
                <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=OffsetCentroY, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                <TextBlock Text="Chamfer / Radius" MinWidth="120" />
                <CheckBox IsChecked="{Binding Path=ChamferAbilited}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Style="{DynamicResource StackPanelStyle1Dialog}">
                <TextBlock Text="Chamfer Value" MinWidth="120" />
                <TextBox ab:AttachedProperties.AutoSelectText="True" Text="{Binding Path=ChamferValue, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" Style="{DynamicResource TextBoxStyle1Dialog}"/>
            </StackPanel>
        </StackPanel>
        <Image VerticalAlignment="Top" MaxWidth="200" MaxHeight="200"  Grid.Column="1" Source="{Binding Path=SelectedItem.Tag}" />

    </Grid>
</UserControl>
